package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author huangpan
* @date 2022-12-02
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("factory_shift_time")
public class FactoryShiftTime extends CommonModel<FactoryShiftTime> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "班次ID")
    private Integer shiftId;

    @ApiModelProperty(value = "休息开始时间")
    private String startTime;

    @ApiModelProperty(value = "休息结束时间")
    private String endTime;

    @ApiModelProperty(value = "备注说明")
    private String remark;

    @ApiModelProperty(value = "创建人")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "类型;(1.开会,2.吃饭,3.其他)")
    private String type;

    @ApiModelProperty(value = "是否禁用;0：否，1：是")
    private String isDisable;

    @ApiModelProperty(value = "是否跨天0：否，1：是")
    private String isAcross;

    public void copyFrom(FactoryShiftTime source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
